//
//  TalkSecTableViewCell.m
//  A段项目
//
//  Created by dlios on 15/7/22.
//  Copyright (c) 2015年 dlios. All rights reserved.
//

#import "TalkSecTableViewCell.h"
#import "BaseHeader.h"

@implementation TalkSecTableViewCell

- (void)dealloc
{
    [_userAvatar release];
    [_time release];
    [_content release];
    [super dealloc];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self create];
    }
    return self;
}

- (void)create
{
    self.userAvatar = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 40, 40)];
    self.userAvatar.layer.cornerRadius = 20;
    self.userAvatar.layer.masksToBounds = YES;
    [self addSubview:_userAvatar];
    [_userAvatar release];
    
    self.userName = [[UILabel alloc] initWithFrame:CGRectMake(_userAvatar.frame.origin.x +_userAvatar.frame.size.width + 10, _userAvatar.frame.origin.y, ScreenWidth / 3 * 2, 20)];
    [self addSubview:_userName];
    [_userName release];
    
    self.time = [[UILabel alloc] initWithFrame:CGRectMake(_userName.frame.origin.x, _userName.frame.origin.y + _userName.frame.size.height + 10, 50, 20)];
    _time.textColor = [UIColor grayColor];
    _time.font = [UIFont systemFontOfSize:13];
    [self addSubview:_time];
    [_time release];

    self.content = [[UILabel alloc] initWithFrame:CGRectMake(_userName.frame.origin.x, _time.frame.origin.y + _time.frame.size.height + 10, ScreenWidth - _userName.frame.origin.x - 10, 30)];
    _content.font = [UIFont systemFontOfSize:14];
    _content.numberOfLines = 0;
    [self addSubview:_content];
    [_content release];


    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
